﻿using JNPF.Basics.Models;
using JNPF.Utils;
using System.Threading.Tasks;

namespace JNPF.Basics.Logic
{
    /// <summary>
    /// 邮件收发
    /// 版 本：V3.0.0
    /// 版 权：引迈信息技术有限公司（https://www.jnpfsoft.com）
    /// 作 者：JNPF开发平台组
    /// 日 期：2017.11.28 
    /// </summary>
    internal interface EmailIService
    {
        /// <summary>
        /// 列表（收件箱）
        /// </summary>
        /// <param name="userId">用户主键</param>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        Task<PageResult<EmailReceiveEntity>> GetReceiveList(string userId, PageInput input);
        /// <summary>
        /// 列表（未读邮件）
        /// </summary>
        /// <param name="userId">用户主键</param>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        Task<PageResult<EmailReceiveEntity>> GetUnreadList(string userId, PageInput input);
        /// <summary>
        /// 列表（星标件）
        /// </summary>
        /// <param name="userId">用户主键</param>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        Task<PageResult<EmailReceiveEntity>> GetStarredList(string userId, PageInput input);
        /// <summary>
        /// 列表（草稿箱）
        /// </summary>
        /// <param name="userId">用户主键</param>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        Task<PageResult<EmailSendEntity>> GetDraftList(string userId, PageInput input);
        /// <summary>
        /// 列表（已发送）
        /// </summary>
        /// <param name="userId">用户主键</param>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        Task<PageResult<EmailSendEntity>> GetSentList(string userId, PageInput input);
        /// <summary>
        /// 信息（配置）
        /// </summary>
        /// <param name="userId">用户主键</param>
        /// <returns></returns>
        Task<EmailConfigEntity> GetConfigInfo(string userId);
        /// <summary>
        /// 信息（收件/发件）
        /// </summary>
        /// <param name="id">主键值</param>
        /// <returns></returns>
        Task<object> GetInfo(string id);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> Delete(object entity);
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> Create(object entity);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> Update(object entity);
        /// <summary>
        /// 保存邮件配置
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> SaveConfig(EmailConfigEntity entity);
        /// <summary>
        /// 获取已收邮件数
        /// </summary>
        /// <param name="mAccount">邮箱账户</param>
        /// <returns></returns>
        Task<int> GetReceiveCount(string mAccount);
    }
}
